package com.dawn.anypossible.base.auth;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * @author: huangxz
 * @Date: 16:28 2024-2-26
 * @Description:
 */

public class MyUserDetailsService implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        MyUserDetails myUserDetails = new MyUserDetails();
        String pwd = MockDbUser.userPwdMap.get(username);
        myUserDetails.setUsername(username);
        myUserDetails.setPassword(pwd);
        return myUserDetails;
    }
}
